VERSION=''; 
re="\"(version)\": \"([^\"]*)\""; 

while read -r l; do 
    if [[ $l =~ $re ]]; then 
     value="${BASH_REMATCH[2]}"; 
     VERSION="$value"; 
    fi 
done < package.json; 

CURRENT_DAY=`date +%Y-%m-%d`

npm run build 

tar cvzf website.tar.gz ./html

mkdir ./v${VERSION}-${CURRENT_DAY}

cp -r ./tar/.  ./v${VERSION}-${CURRENT_DAY}

mv website.tar.gz ./v${VERSION}-${CURRENT_DAY}
